using System.Collections.Generic;
using Kopernikus.Parsing.GenericLexing;
using Kopernikus.Parsing.Lexing;
using NUnit.Framework;

namespace Kopernikus.Parsing.Tests.GenericLexing
{
    [TestFixture]
    public class TestDefaultLexing
    {
        private class L
        {
            [LexDefault("abc", "a", "b", "c")]
            public string t_default(LexerMatch m)
            {
                return m.Value;
            }
        }

        [Test]
        public void Test()
        {
            GenericLexer<L, string> lexer = GenericLexer<L, string>.Create(new L());

            List<string> l = new List<string>(lexer.Scan("abcbcacabcc"));

            Assert.AreEqual("abc,b,c,a,c,abc,c", string.Join(",", l.ToArray()));
        }
    }
}